fix: eliminate props divergence between CoreNode and CoreTextNode#3
Merged
Conversation
CoreNode's constructor was field-copying into a new this.props object, while CoreTextNode stored a reference to the original props as this.textProps. After any setter call (e.g. node.color = 0xff0000ff), this.props and this.textProps diverged — shared fields like color, x, y on textProps went stale. Since resolveNodeDefaults already creates a fresh single-use object, the second copy was redundant. Now this.props = props directly, with the six setter-managed fields destructured before being nulled in-place so the setters can re-apply them. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
fixes the architectural issue of bug #1 |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CoreTextNode.textPropsandCoreNode.propsdiverged after setter calls. CoreNode's constructor was field-copying into a newthis.propsobject, while CoreTextNode kept a reference to the original incomingpropsasthis.textProps. After any property setter (e.g.node.color = 0xff0000ff), shared fields likecolor,x,yontextPropswent stale.resolveNodeDefaultsalready creates a fresh single-use object, so the second allocation was unnecessary.this.props = propsdirectly, with the six setter-managed fields (texture,shader,src,rtt,boundsMargin,scale) destructured before being nulled in-place.Test plan
colorvia setter, confirmtextProps.colormatches)🤖 Generated with Claude Code